package com.woniu.commentorder.console;

import com.hc.entity.NoticeArriva;
import com.hc.entity.Order;
import com.hc.utils.ResponseEntity;
import com.woniu.commentorder.mapper.OrderMapper;
import com.woniu.commentorder.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description：
 * @Author：曹杰克
 * @CreateTime：2022/10/29 11:51
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    OrderService orderService;
    //根据订单编号查询订单
    @PostMapping("/selectByOrderCode")
    public ResponseEntity selectByOrderCode(@RequestBody Order order) {
        Order order1 = orderService.selectByOrderCode(order);
        return new ResponseEntity("200","ok",order1);
    }

    //根据订单编号修改订单状态
    @PostMapping("/changeByOrderCode")
    public ResponseEntity changeByOrderCode(@RequestBody Order order) {
        boolean b = orderService.changeByOrderCode(order);
        return new ResponseEntity("200","ok",b);
    }
}
